class School():
    School = "大学城"
    def __init__(self,name,addr):
        self.name = name
        self.addr = addr
        self.classes = []
    
    def related_class(self,class_obj):
        self.classes.append(class_obj)


    def show_class(self):
        print(f"{self.name} {self.addr}班级如下=======")
        if not self.classes:
            print("暂时没有班级！")
        else:
            for class_obj in self.classes:
                class_obj.show_crouse()
            

class Classes():
    def __init__(self,name):
        self.name = name
        self.crouse = []
    
    def related_crouse(self,crouse_obj):
        self.crouse.append(crouse_obj)

    def show_crouse(self):
        print(f"{self.name}课程",end = "\n")
        for crouse_obj in self.crouse:
            crouse_obj.show_info()



class Crouse():
    def __init__(self,name,week,price):
        self.name = name
        self.week = week
        self.price = price

    def show_info(self):
        print(f"课程名:{self.name} 周期:{self.week} 价格:{self.price}")
        

class  Students():
    pass

if __name__ == "__main__":
    #课程
    crouse1 = Crouse("python全栈开发","7周",2000)
    crouse2 = Crouse("linux","7周",2000)
    crouse1.show_info()
    #班级
    class1 = Classes("电信1803")
    class1.related_crouse(crouse1)
    class2 = Classes("电信1802")
    class2.related_crouse(crouse1)
    class2.related_crouse(crouse2)
    # class1.show_crouse()
    #学校
    school1 = School("武昌首义学院","东校区")  
    school1.related_class(class1)
    school1.related_class(class2)
    school1.show_class()

